(function(){
	Ext.onReady(function(){
		//定义模型
		Ext.define("Person",{
			extend:'Ext.data.Model',
			fields:[
				{name:"name",type:'string'},
				{name:'age',type:'int'},
				{name:'email',type:'string'}
			]
		});
		
		//定义数据，一个数组
		var users = [
			{name:"laoluo",age:32,email:"laoluo@263.com"},
			{name:"bibi",age:32,email:"bibi@263.com"}
		];
		
		//创建内存代理关联数据与模型
		var memoryProxy = Ext.create('Ext.data.proxy.Memory',{
			data:users,
			model:'Person'
		});
		
		//插入一个新数据
		users.push({name:'xinlin',age:5,email:"xinlin@263.com"});
		
		
		//数据操作，这里演示Read
		memoryProxy.read(new Ext.data.Operation(),function(result){
			var records = result.resultSet.records;
			Ext.Array.each(records,function(item){
				alert(item.get('name'));
			});
		});
	});
})();